package com.company.structural.adapter_pattern.adapter;

import com.company.structural.adapter_pattern.adaptee.PoliceLamp;
import com.company.structural.adapter_pattern.adaptee.PoliceSound;
import com.company.structural.adapter_pattern.targets.CarController;

/**
 * @ClassName PoliceCarAdapter
 * @Author tiezheng.han
 * @Date 2020/8/31 10:56
 **/
public class PoliceCarAdapter extends CarController {

    /**
     * 定义适配者PoliceSound对象
     */
    private PoliceSound sound;
    /**
     * 定义适配者PoliceLamp对象
     */
    private PoliceLamp lamp;

    public PoliceCarAdapter() {
        sound = new PoliceSound();
        lamp = new PoliceLamp();
    }

    @Override
    public void phinate() {
        sound.alarmSoud();
    }

    @Override
    public void twinkle() {
        lamp.alarmLamp();
    }

    @Override
    public void move() {
        System.out.println("警车移动");
    }
}
